#include "negatedconstraint.h"

NegatedConstraint::NegatedConstraint(boost::shared_ptr<Constraint> constraint)
	: constraint_(constraint)
{
}

NegatedConstraint::~NegatedConstraint()
{
}

/// Tests a schedule object to see if it fulfills the logical negation of
/// the stored constraint.
/// \param schedule The schedule object against which the constraint is tested.
/// \return True if the schedule fulfills the negation of the stored
/// constraint, false otherwise.
bool NegatedConstraint::consider(const Schedule& schedule)
{
	return ! constraint_->consider(schedule);
}

std::string NegatedConstraint::to_string()
{
    return "NOT " + constraint_->to_string();
}
